
<!doctype html>
<html lang="en" class="no-js">
  <head>
    
      <meta charset="utf-8">
      <meta name="viewport" content="width=device-width,initial-scale=1">
      
      
      
        <link rel="canonical" href="https://daptin.github.io/daptin/apis/crud/">
      
      <link rel="icon" href="../../images/theme-favicon.png">
      <meta name="generator" content="mkdocs-1.2.3, mkdocs-material-8.2.4">
    
    
      
        <title>Metadata API - Daptin</title>
      
    
    
      <link rel="stylesheet" href="../../assets/stylesheets/main.2d9f7617.min.css">
      
        
        <link rel="stylesheet" href="../../assets/stylesheets/palette.e6a45f82.min.css">
        
      
    
    
    
      
        
        
        <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
        <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,700,700i%7CRoboto+Mono:400,400i,700,700i&display=fallback">
        <style>:root{--md-text-font:"Roboto";--md-code-font:"Roboto Mono"}</style>
      
    
    
      <link rel="stylesheet" href="../../css/theme_extra.css">
    
    <script>__md_scope=new URL("../..",location),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
    
      

    
    
  </head>
  
  
    
    
    
    
    
    <body dir="ltr" data-md-color-scheme="" data-md-color-primary="none" data-md-color-accent="none">
  
    
    
    <input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
    <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
    <label class="md-overlay" for="__drawer"></label>
    <div data-md-component="skip">
      
        
        <a href="#api-reference" class="md-skip">
          Skip to content
        </a>
      
    </div>
    <div data-md-component="announce">
      
    </div>
    
    
      

<header class="md-header" data-md-component="header">
  <nav class="md-header__inner md-grid" aria-label="Header">
    <a href="../.." title="Daptin" class="md-header__button md-logo" aria-label="Daptin" data-md-component="logo">
      
  <img src="../../images/theme-logo.png" alt="logo">

    </a>
    <label class="md-header__button md-icon" for="__drawer">
      <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3V6m0 5h18v2H3v-2m0 5h18v2H3v-2z"/></svg>
    </label>
    <div class="md-header__title" data-md-component="header-title">
      <div class="md-header__ellipsis">
        <div class="md-header__topic">
          <span class="md-ellipsis">
            Daptin
          </span>
        </div>
        <div class="md-header__topic" data-md-component="header-topic">
          <span class="md-ellipsis">
            
              Metadata API
            
          </span>
        </div>
      </div>
    </div>
    
    
    
      <label class="md-header__button md-icon" for="__search">
        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5z"/></svg>
      </label>
      <div class="md-search" data-md-component="search" role="dialog">
  <label class="md-search__overlay" for="__search"></label>
  <div class="md-search__inner" role="search">
    <form class="md-search__form" name="search">
      <input type="text" class="md-search__input" name="query" aria-label="Search" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" required>
      <label class="md-search__icon md-icon" for="__search">
        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5z"/></svg>
        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>
      </label>
      <nav class="md-search__options" aria-label="Search">
        
        <button type="reset" class="md-search__icon md-icon" aria-label="Clear" tabindex="-1">
          <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"/></svg>
        </button>
      </nav>
      
    </form>
    <div class="md-search__output">
      <div class="md-search__scrollwrap" data-md-scrollfix>
        <div class="md-search-result" data-md-component="search-result">
          <div class="md-search-result__meta">
            Initializing search
          </div>
          <ol class="md-search-result__list"></ol>
        </div>
      </div>
    </div>
  </div>
</div>
    
    
  </nav>
  
</header>
    
    <div class="md-container" data-md-component="container">
      
      
        
          
        
      
      <main class="md-main" data-md-component="main">
        <div class="md-main__inner md-grid">
          
            
              
              <div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation" >
                <div class="md-sidebar__scrollwrap">
                  <div class="md-sidebar__inner">
                    


<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
  <label class="md-nav__title" for="__drawer">
    <a href="../.." title="Daptin" class="md-nav__button md-logo" aria-label="Daptin" data-md-component="logo">
      
  <img src="../../images/theme-logo.png" alt="logo">

    </a>
    Daptin
  </label>
  
  <ul class="md-nav__list" data-md-scrollfix>
    
      
      
      

  
  
  
    
    <li class="md-nav__item md-nav__item--nested">
      
      
        <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_1" type="checkbox" id="__nav_1" >
      
      
      
      
        <label class="md-nav__link" for="__nav_1">
          Introduction
          <span class="md-nav__icon md-icon"></span>
        </label>
      
      <nav class="md-nav" aria-label="Introduction" data-md-level="1">
        <label class="md-nav__title" for="__nav_1">
          <span class="md-nav__icon md-icon"></span>
          Introduction
        </label>
        <ul class="md-nav__list" data-md-scrollfix>
          
            
              
  
  
  
    <li class="md-nav__item">
      <a href="../.." class="md-nav__link">
        About
      </a>
    </li>
  

            
          
            
              
  
  
  
    <li class="md-nav__item">
      <a href="../../faq.md" class="md-nav__link">
        FAQs
      </a>
    </li>
  

            
          
            
              
  
  
  
    
    <li class="md-nav__item md-nav__item--nested">
      
      
        <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_1_3" type="checkbox" id="__nav_1_3" >
      
      
      
      
        <label class="md-nav__link" for="__nav_1_3">
          How to use
          <span class="md-nav__icon md-icon"></span>
        </label>
      
      <nav class="md-nav" aria-label="How to use" data-md-level="2">
        <label class="md-nav__title" for="__nav_1_3">
          <span class="md-nav__icon md-icon"></span>
          How to use
        </label>
        <ul class="md-nav__list" data-md-scrollfix>
          
            
              
  
  
  
    <li class="md-nav__item">
      <a href="../../setting-up/installation/" class="md-nav__link">
        Download and Deploy
      </a>
    </li>
  

            
          
            
              
  
  
  
    <li class="md-nav__item">
      <a href="../../setting-up/settingup/" class="md-nav__link">
        Accessing the web dashboard
      </a>
    </li>
  

            
          
        </ul>
      </nav>
    </li>
  

            
          
        </ul>
      </nav>
    </li>
  

    
      
      
      

  
  
    
  
  
    
    <li class="md-nav__item md-nav__item--active md-nav__item--nested">
      
      
        <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_2" type="checkbox" id="__nav_2" checked>
      
      
      
      
        <label class="md-nav__link" for="__nav_2">
          Documentation
          <span class="md-nav__icon md-icon"></span>
        </label>
      
      <nav class="md-nav" aria-label="Documentation" data-md-level="1">
        <label class="md-nav__title" for="__nav_2">
          <span class="md-nav__icon md-icon"></span>
          Documentation
        </label>
        <ul class="md-nav__list" data-md-scrollfix>
          
            
              
  
  
  
    
    <li class="md-nav__item md-nav__item--nested">
      
      
        <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_2_1" type="checkbox" id="__nav_2_1" >
      
      
      
      
        <label class="md-nav__link" for="__nav_2_1">
          User management
          <span class="md-nav__icon md-icon"></span>
        </label>
      
      <nav class="md-nav" aria-label="User management" data-md-level="2">
        <label class="md-nav__title" for="__nav_2_1">
          <span class="md-nav__icon md-icon"></span>
          User management
        </label>
        <ul class="md-nav__list" data-md-scrollfix>
          
            
              
  
  
  
    <li class="md-nav__item">
      <a href="../../user-management/new-users/" class="md-nav__link">
        New User
      </a>
    </li>
  

            
          
            
              
  
  
  
    <li class="md-nav__item">
      <a href="../../user-management/access/" class="md-nav__link">
        Access Permissions
      </a>
    </li>
  

            
          
            
              
  
  
  
    <li class="md-nav__item">
      <a href="../../user-management/signin/" class="md-nav__link">
        Sign in API
      </a>
    </li>
  

            
          
        </ul>
      </nav>
    </li>
  

            
          
            
              
  
  
  
    <li class="md-nav__item">
      <a href="../../setting-up/data_modeling/" class="md-nav__link">
        Data model
      </a>
    </li>
  

            
          
            
              
  
  
    
  
  
    
    <li class="md-nav__item md-nav__item--active md-nav__item--nested">
      
      
        <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_2_3" type="checkbox" id="__nav_2_3" checked>
      
      
      
      
        <label class="md-nav__link" for="__nav_2_3">
          HTTP JSON API
          <span class="md-nav__icon md-icon"></span>
        </label>
      
      <nav class="md-nav" aria-label="HTTP JSON API" data-md-level="2">
        <label class="md-nav__title" for="__nav_2_3">
          <span class="md-nav__icon md-icon"></span>
          HTTP JSON API
        </label>
        <ul class="md-nav__list" data-md-scrollfix>
          
            
              
  
  
  
    <li class="md-nav__item">
      <a href="./" class="md-nav__link">
        CRUD API
      </a>
    </li>
  

            
          
            
              
  
  
  
    <li class="md-nav__item">
      <a href="./" class="md-nav__link">
        Action API
      </a>
    </li>
  

            
          
            
              
  
  
  
    <li class="md-nav__item">
      <a href="./" class="md-nav__link">
        Relation API
      </a>
    </li>
  

            
          
            
              
  
  
  
    <li class="md-nav__item">
      <a href="./" class="md-nav__link">
        Aggregation API
      </a>
    </li>
  

            
          
            
              
  
  
  
    <li class="md-nav__item">
      <a href="./" class="md-nav__link">
        State machine API
      </a>
    </li>
  

            
          
            
              
  
  
    
  
  
    <li class="md-nav__item md-nav__item--active">
      
      <input class="md-nav__toggle md-toggle" data-md-toggle="toc" type="checkbox" id="__toc">
      
      
        
      
      
        <label class="md-nav__link md-nav__link--active" for="__toc">
          Metadata API
          <span class="md-nav__icon md-icon"></span>
        </label>
      
      <a href="./" class="md-nav__link md-nav__link--active">
        Metadata API
      </a>
      
        

<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
  
  
  
    
  
  
    <label class="md-nav__title" for="__toc">
      <span class="md-nav__icon md-icon"></span>
      Table of contents
    </label>
    <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
      
        <li class="md-nav__item">
  <a href="#read" class="md-nav__link">
    Read
  </a>
  
    <nav class="md-nav" aria-label="Read">
      <ul class="md-nav__list">
        
          <li class="md-nav__item">
  <a href="#query-parameters" class="md-nav__link">
    Query Parameters
  </a>
  
    <nav class="md-nav" aria-label="Query Parameters">
      <ul class="md-nav__list">
        
          <li class="md-nav__item">
  <a href="#fieldscol1col2" class="md-nav__link">
    ?fields=col1,col2
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#filtervalue" class="md-nav__link">
    ?filter=value
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#queryqueryobject" class="md-nav__link">
    ?query=[QueryObject]
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#included_relationscolumn_name1column_name2" class="md-nav__link">
    ?included_relations=column_name1,column_name2
  </a>
  
</li>
        
      </ul>
    </nav>
  
</li>
        
          <li class="md-nav__item">
  <a href="#response" class="md-nav__link">
    Response
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#examples" class="md-nav__link">
    Examples
  </a>
  
    <nav class="md-nav" aria-label="Examples">
      <ul class="md-nav__list">
        
          <li class="md-nav__item">
  <a href="#curl-example" class="md-nav__link">
    Curl example
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#jquery-ajax-example" class="md-nav__link">
    jQuery ajax example
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#node-js-example" class="md-nav__link">
    Node js example
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#python-example" class="md-nav__link">
    Python example
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#php-example" class="md-nav__link">
    PHP example
  </a>
  
</li>
        
      </ul>
    </nav>
  
</li>
        
          <li class="md-nav__item">
  <a href="#filtering" class="md-nav__link">
    Filtering
  </a>
  
    <nav class="md-nav" aria-label="Filtering">
      <ul class="md-nav__list">
        
          <li class="md-nav__item">
  <a href="#example" class="md-nav__link">
    Example
  </a>
  
</li>
        
      </ul>
    </nav>
  
</li>
        
      </ul>
    </nav>
  
</li>
      
        <li class="md-nav__item">
  <a href="#create" class="md-nav__link">
    Create
  </a>
  
</li>
      
        <li class="md-nav__item">
  <a href="#update" class="md-nav__link">
    Update
  </a>
  
</li>
      
        <li class="md-nav__item">
  <a href="#delete" class="md-nav__link">
    Delete
  </a>
  
</li>
      
        <li class="md-nav__item">
  <a href="#execute" class="md-nav__link">
    Execute
  </a>
  
</li>
      
        <li class="md-nav__item">
  <a href="#relations" class="md-nav__link">
    Relations
  </a>
  
</li>
      
        <li class="md-nav__item">
  <a href="#api-overview" class="md-nav__link">
    API Overview
  </a>
  
    <nav class="md-nav" aria-label="API Overview">
      <ul class="md-nav__list">
        
          <li class="md-nav__item">
  <a href="#crud-api" class="md-nav__link">
    CRUD API
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#action-api" class="md-nav__link">
    Action API
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#relation-apis" class="md-nav__link">
    Relation APIs
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#aggregate-api" class="md-nav__link">
    Aggregate API
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#state-machine-apis" class="md-nav__link">
    State machine APIs
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#websocket-api-wip" class="md-nav__link">
    Websocket API (wip)
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#metadata-api" class="md-nav__link">
    Metadata API
  </a>
  
</li>
        
      </ul>
    </nav>
  
</li>
      
    </ul>
  
</nav>
      
    </li>
  

            
          
        </ul>
      </nav>
    </li>
  

            
          
            
              
  
  
  
    
    <li class="md-nav__item md-nav__item--nested">
      
      
        <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_2_4" type="checkbox" id="__nav_2_4" >
      
      
      
      
        <label class="md-nav__link" for="__nav_2_4">
          Actions
          <span class="md-nav__icon md-icon"></span>
        </label>
      
      <nav class="md-nav" aria-label="Actions" data-md-level="2">
        <label class="md-nav__title" for="__nav_2_4">
          <span class="md-nav__icon md-icon"></span>
          Actions
        </label>
        <ul class="md-nav__list" data-md-scrollfix>
          
            
              
  
  
  
    <li class="md-nav__item">
      <a href="../../actions/actions/" class="md-nav__link">
        What are actions
      </a>
    </li>
  

            
          
            
              
  
  
  
    <li class="md-nav__item">
      <a href="../../actions/default_actions/" class="md-nav__link">
        Actions list
      </a>
    </li>
  

            
          
            
              
  
  
  
    <li class="md-nav__item">
      <a href="../../actions/outcomes/" class="md-nav__link">
        Action OutComes
      </a>
    </li>
  

            
          
            
              
  
  
  
    <li class="md-nav__item">
      <a href="../../actions/examples/" class="md-nav__link">
        Examples
      </a>
    </li>
  

            
          
        </ul>
      </nav>
    </li>
  

            
          
            
              
  
  
  
    <li class="md-nav__item">
      <a href="../../features/enable-graphql/" class="md-nav__link">
        GraphQL
      </a>
    </li>
  

            
          
            
              
  
  
  
    <li class="md-nav__item">
      <a href="../../features/enable-data-auditing/" class="md-nav__link">
        Data Auditing
      </a>
    </li>
  

            
          
            
              
  
  
  
    <li class="md-nav__item">
      <a href="../../features/enable-multilingual-table/" class="md-nav__link">
        Multilingual Table
      </a>
    </li>
  

            
          
            
              
  
  
  
    <li class="md-nav__item">
      <a href="../../features/enable-smtp-imap/" class="md-nav__link">
        SMTP/IMPS server
      </a>
    </li>
  

            
          
            
              
  
  
  
    <li class="md-nav__item">
      <a href="../../state/machines/" class="md-nav__link">
        State tracking
      </a>
    </li>
  

            
          
            
              
  
  
  
    
    <li class="md-nav__item md-nav__item--nested">
      
      
        <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_2_10" type="checkbox" id="__nav_2_10" >
      
      
      
      
        <label class="md-nav__link" for="__nav_2_10">
          OAuth
          <span class="md-nav__icon md-icon"></span>
        </label>
      
      <nav class="md-nav" aria-label="OAuth" data-md-level="2">
        <label class="md-nav__title" for="__nav_2_10">
          <span class="md-nav__icon md-icon"></span>
          OAuth
        </label>
        <ul class="md-nav__list" data-md-scrollfix>
          
            
              
  
  
  
    <li class="md-nav__item">
      <a href="../../extend/oauth_connection/" class="md-nav__link">
        OAuth Connections
      </a>
    </li>
  

            
          
            
              
  
  
  
    <li class="md-nav__item">
      <a href="../../extend/oauth_token/" class="md-nav__link">
        OAuth Tokens
      </a>
    </li>
  

            
          
        </ul>
      </nav>
    </li>
  

            
          
            
              
  
  
  
    <li class="md-nav__item">
      <a href="../../integrations/overview/" class="md-nav__link">
        3rd party API Integrations
      </a>
    </li>
  

            
          
            
              
  
  
  
    
    <li class="md-nav__item md-nav__item--nested">
      
      
        <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_2_12" type="checkbox" id="__nav_2_12" >
      
      
      
      
        <label class="md-nav__link" for="__nav_2_12">
          Cloud store
          <span class="md-nav__icon md-icon"></span>
        </label>
      
      <nav class="md-nav" aria-label="Cloud store" data-md-level="2">
        <label class="md-nav__title" for="__nav_2_12">
          <span class="md-nav__icon md-icon"></span>
          Cloud store
        </label>
        <ul class="md-nav__list" data-md-scrollfix>
          
            
              
  
  
  
    <li class="md-nav__item">
      <a href="../../cloudstore/" class="md-nav__link">
        Cloud store
      </a>
    </li>
  

            
          
            
              
  
  
  
    <li class="md-nav__item">
      <a href="../../cloudstore/cloudstore/" class="md-nav__link">
        Available cloud stores
      </a>
    </li>
  

            
          
            
              
  
  
  
    <li class="md-nav__item">
      <a href="../../cloudstore/cloudstore/" class="md-nav__link">
        Asset columns
      </a>
    </li>
  

            
          
            
              
  
  
  
    <li class="md-nav__item">
      <a href="../../cloudstore/cloudstore/" class="md-nav__link">
        Asset columns
      </a>
    </li>
  

            
          
            
              
  
  
  
    <li class="md-nav__item">
      <a href="../../cloudstore/sites/" class="md-nav__link">
        Sites
      </a>
    </li>
  

            
          
        </ul>
      </nav>
    </li>
  

            
          
            
              
  
  
  
    <li class="md-nav__item">
      <a href="../../cloudstore/assetcolumns/" class="md-nav__link">
        Cloud store backed asset columns
      </a>
    </li>
  

            
          
            
              
  
  
  
    <li class="md-nav__item">
      <a href="../../websockets/websocket/" class="md-nav__link">
        Websockets
      </a>
    </li>
  

            
          
            
              
  
  
  
    
    <li class="md-nav__item md-nav__item--nested">
      
      
        <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_2_15" type="checkbox" id="__nav_2_15" >
      
      
      
      
        <label class="md-nav__link" for="__nav_2_15">
          Sub-sites
          <span class="md-nav__icon md-icon"></span>
        </label>
      
      <nav class="md-nav" aria-label="Sub-sites" data-md-level="2">
        <label class="md-nav__title" for="__nav_2_15">
          <span class="md-nav__icon md-icon"></span>
          Sub-sites
        </label>
        <ul class="md-nav__list" data-md-scrollfix>
          
            
              
  
  
  
    <li class="md-nav__item">
      <a href="../../subsite/subsite/" class="md-nav__link">
        Creating a subsite
      </a>
    </li>
  

            
          
            
              
  
  
  
    <li class="md-nav__item">
      <a href="../../subsite/grapes/" class="md-nav__link">
        Live editing a subsite
      </a>
    </li>
  

            
          
            
              
  
  
  
    <li class="md-nav__item">
      <a href="../../subsite/basic_auth/" class="md-nav__link">
        Basic Authentication
      </a>
    </li>
  

            
          
        </ul>
      </nav>
    </li>
  

            
          
            
              
  
  
  
    
    <li class="md-nav__item md-nav__item--nested">
      
      
        <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_2_16" type="checkbox" id="__nav_2_16" >
      
      
      
      
        <label class="md-nav__link" for="__nav_2_16">
          Internal Documents
          <span class="md-nav__icon md-icon"></span>
        </label>
      
      <nav class="md-nav" aria-label="Internal Documents" data-md-level="2">
        <label class="md-nav__title" for="__nav_2_16">
          <span class="md-nav__icon md-icon"></span>
          Internal Documents
        </label>
        <ul class="md-nav__list" data-md-scrollfix>
          
            
              
  
  
  
    <li class="md-nav__item">
      <a href="../../data-modeling/data_storage/" class="md-nav__link">
        Data store format
      </a>
    </li>
  

            
          
            
              
  
  
  
    <li class="md-nav__item">
      <a href="../../extend/data_exchange/" class="md-nav__link">
        Data exchange and sync
      </a>
    </li>
  

            
          
            
              
  
  
  
    <li class="md-nav__item">
      <a href="../../streams/streams/" class="md-nav__link">
        Data streams
      </a>
    </li>
  

            
          
        </ul>
      </nav>
    </li>
  

            
          
            
              
  
  
  
    <li class="md-nav__item">
      <a href="../../setting-up/configurations/" class="md-nav__link">
        Global Configuration
      </a>
    </li>
  

            
          
        </ul>
      </nav>
    </li>
  

    
  </ul>
</nav>
                  </div>
                </div>
              </div>
            
            
              
              <div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" >
                <div class="md-sidebar__scrollwrap">
                  <div class="md-sidebar__inner">
                    

<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
  
  
  
    
  
  
    <label class="md-nav__title" for="__toc">
      <span class="md-nav__icon md-icon"></span>
      Table of contents
    </label>
    <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
      
        <li class="md-nav__item">
  <a href="#read" class="md-nav__link">
    Read
  </a>
  
    <nav class="md-nav" aria-label="Read">
      <ul class="md-nav__list">
        
          <li class="md-nav__item">
  <a href="#query-parameters" class="md-nav__link">
    Query Parameters
  </a>
  
    <nav class="md-nav" aria-label="Query Parameters">
      <ul class="md-nav__list">
        
          <li class="md-nav__item">
  <a href="#fieldscol1col2" class="md-nav__link">
    ?fields=col1,col2
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#filtervalue" class="md-nav__link">
    ?filter=value
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#queryqueryobject" class="md-nav__link">
    ?query=[QueryObject]
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#included_relationscolumn_name1column_name2" class="md-nav__link">
    ?included_relations=column_name1,column_name2
  </a>
  
</li>
        
      </ul>
    </nav>
  
</li>
        
          <li class="md-nav__item">
  <a href="#response" class="md-nav__link">
    Response
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#examples" class="md-nav__link">
    Examples
  </a>
  
    <nav class="md-nav" aria-label="Examples">
      <ul class="md-nav__list">
        
          <li class="md-nav__item">
  <a href="#curl-example" class="md-nav__link">
    Curl example
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#jquery-ajax-example" class="md-nav__link">
    jQuery ajax example
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#node-js-example" class="md-nav__link">
    Node js example
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#python-example" class="md-nav__link">
    Python example
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#php-example" class="md-nav__link">
    PHP example
  </a>
  
</li>
        
      </ul>
    </nav>
  
</li>
        
          <li class="md-nav__item">
  <a href="#filtering" class="md-nav__link">
    Filtering
  </a>
  
    <nav class="md-nav" aria-label="Filtering">
      <ul class="md-nav__list">
        
          <li class="md-nav__item">
  <a href="#example" class="md-nav__link">
    Example
  </a>
  
</li>
        
      </ul>
    </nav>
  
</li>
        
      </ul>
    </nav>
  
</li>
      
        <li class="md-nav__item">
  <a href="#create" class="md-nav__link">
    Create
  </a>
  
</li>
      
        <li class="md-nav__item">
  <a href="#update" class="md-nav__link">
    Update
  </a>
  
</li>
      
        <li class="md-nav__item">
  <a href="#delete" class="md-nav__link">
    Delete
  </a>
  
</li>
      
        <li class="md-nav__item">
  <a href="#execute" class="md-nav__link">
    Execute
  </a>
  
</li>
      
        <li class="md-nav__item">
  <a href="#relations" class="md-nav__link">
    Relations
  </a>
  
</li>
      
        <li class="md-nav__item">
  <a href="#api-overview" class="md-nav__link">
    API Overview
  </a>
  
    <nav class="md-nav" aria-label="API Overview">
      <ul class="md-nav__list">
        
          <li class="md-nav__item">
  <a href="#crud-api" class="md-nav__link">
    CRUD API
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#action-api" class="md-nav__link">
    Action API
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#relation-apis" class="md-nav__link">
    Relation APIs
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#aggregate-api" class="md-nav__link">
    Aggregate API
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#state-machine-apis" class="md-nav__link">
    State machine APIs
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#websocket-api-wip" class="md-nav__link">
    Websocket API (wip)
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#metadata-api" class="md-nav__link">
    Metadata API
  </a>
  
</li>
        
      </ul>
    </nav>
  
</li>
      
    </ul>
  
</nav>
                  </div>
                </div>
              </div>
            
          
          <div class="md-content" data-md-component="content">
            <article class="md-content__inner md-typeset">
              
                


<h1 id="api-reference">API reference</h1>
<p>Daptin exposes various endpoints for each entity defined in the schema:</p>
<ul>
<li>Create</li>
<li>Find one</li>
<li>Update</li>
<li>Delete</li>
<li>Find all</li>
<li>Find relations</li>
<li>Execute action</li>
<li>Aggregate</li>
<li>State management</li>
</ul>
<p>All endpoints allow authentication using the Authorization Header.</p>
<h2 id="read">Read</h2>
<h3 id="query-parameters">Query Parameters</h3>
<h4 id="fieldscol1col2">?fields=col1,col2</h4>
<p>Include values for columns col1 and col2. Skip other columns in responsee</p>
<h4 id="filtervalue">?filter=value</h4>
<p>Filter results by searching <code>value</code> in indexed label columns in the table</p>
<h4 id="queryqueryobject">?query=[QueryObject]</h4>
<ul>
<li>
<p>QueryObject</p>
<p><code>{"column": "col1", "operator": "is", "value": "value 1"}</code></p>
</li>
</ul>
<p>All objects are ANDed together in the query</p>
<p>List of <a href="#Filtering">all operators here</a></p>
<h4 id="included_relationscolumn_name1column_name2">?included_relations=column_name1,column_name2</h4>
<p>Fetch associated second level row, or asset object and return as part of included objects in the response</p>
<p>Use</p>
<table>
<thead>
<tr>
<th>Name</th>
<th>parameter type</th>
<th>default value</th>
<th>example value</th>
</tr>
</thead>
<tbody>
<tr>
<td>page[number]</td>
<td>integer</td>
<td>1</td>
<td>5</td>
</tr>
<tr>
<td>page[size]</td>
<td>integer</td>
<td>10</td>
<td>100</td>
</tr>
<tr>
<td>query</td>
<td>json base64</td>
<td>[]</td>
<td>[{"column": "name", "operator": "is", "value": "england"}]</td>
</tr>
<tr>
<td>group</td>
<td>string</td>
<td>-</td>
<td>[{"column": "name", "order": "desc"}]</td>
</tr>
<tr>
<td>included_relations</td>
<td>comma separated string</td>
<td>-</td>
<td>user post author</td>
</tr>
<tr>
<td>sort</td>
<td>comma separated string</td>
<td>-</td>
<td>created_at amount guest_count</td>
</tr>
<tr>
<td>filter</td>
<td>string</td>
<td>-</td>
<td>england</td>
</tr>
</tbody>
</table>
<h3 id="response">Response</h3>
<div class="admonition example">
<p class="admonition-title">Response example</p>
<div class="highlight"><pre><span></span><code><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="nt">&quot;links&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">        </span><span class="nt">&quot;current_page&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="nt">&quot;from&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="nt">&quot;last_page&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="nt">&quot;per_page&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">10</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="nt">&quot;to&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">10</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="nt">&quot;total&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="w"></span>
<span class="w">    </span><span class="p">},</span><span class="w"></span>
<span class="w">    </span><span class="nt">&quot;data&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">[{</span><span class="w"></span>
<span class="w">        </span><span class="nt">&quot;type&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;book&quot;</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="nt">&quot;id&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;29d11cb3-3fad-4972-bf3b-9cfc6da9e6a6&quot;</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="nt">&quot;attributes&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">            </span><span class="nt">&quot;__type&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;book&quot;</span><span class="p">,</span><span class="w"></span>
<span class="w">            </span><span class="nt">&quot;confirmed&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w"></span>
<span class="w">            </span><span class="nt">&quot;created_at&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;2018-04-05 15:47:29&quot;</span><span class="p">,</span><span class="w"></span>
<span class="w">            </span><span class="nt">&quot;title&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;book title&quot;</span><span class="p">,</span><span class="w"></span>
<span class="w">            </span><span class="nt">&quot;name&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;book name&quot;</span><span class="p">,</span><span class="w"></span>
<span class="w">            </span><span class="nt">&quot;permission&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">127127127</span><span class="p">,</span><span class="w"></span>
<span class="w">            </span><span class="nt">&quot;reference_id&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;29d11cb3-3fad-4972-bf3b-9cfc6da9e6a6&quot;</span><span class="p">,</span><span class="w"></span>
<span class="w">            </span><span class="nt">&quot;updated_at&quot;</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="p">,</span><span class="w"></span>
<span class="w">            </span><span class="nt">&quot;user_id&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;696c98d3-3b8b-41da-a510-08e6948cf661&quot;</span><span class="w"></span>
<span class="w">        </span><span class="p">},</span><span class="w"></span>
<span class="w">        </span><span class="nt">&quot;relationships&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">            </span><span class="nt">&quot;author_id&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">                </span><span class="nt">&quot;links&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">                    </span><span class="nt">&quot;related&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;/api/book/&lt;book-id/author_id&quot;</span><span class="p">,</span><span class="w"></span>
<span class="w">                    </span><span class="nt">&quot;self&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;/api/book/&lt;book-id&gt;/relationships/author_id&quot;</span><span class="w"></span>
<span class="w">                </span><span class="p">},</span><span class="w"></span>
<span class="w">                </span><span class="nt">&quot;data&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">[]</span><span class="w"></span>
<span class="w">            </span><span class="p">}</span><span class="w"></span>
<span class="w">        </span><span class="p">}</span><span class="w"></span>
<span class="w">    </span><span class="p">}]</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>
</div>
<h3 id="examples">Examples</h3>
<h4 id="curl-example">Curl example</h4>
<div class="codehilite"><pre><span></span><code><span class="n">curl</span><span class="w"> </span><span class="s1">&#39;/api/&lt;entityName&gt;?sort=&amp;page[number]=1&amp;page[size]=10&#39;</span><span class="w"> </span><span class="err">\</span><span class="w"></span>
<span class="w">  </span><span class="o">-</span><span class="n">H</span><span class="w"> </span><span class="s1">&#39;Authorization: Bearer &lt;AccessToken&gt;&#39;</span><span class="w"></span>
</code></pre></div>

<h4 id="jquery-ajax-example">jQuery ajax example</h4>
<div class="codehilite"><pre><span></span><code><span class="err">$</span><span class="p">.</span><span class="n">ajax</span><span class="p">(</span><span class="err">{</span><span class="w"></span>
<span class="w">    </span><span class="k">method</span><span class="err">:</span><span class="w"> </span><span class="ss">&quot;GET&quot;</span><span class="p">,</span><span class="w"></span>
<span class="w">    </span><span class="nl">url</span><span class="p">:</span><span class="w"> </span><span class="s1">&#39;/api/&lt;entityName&gt;?sort=&amp;page[number]=1&amp;page[size]=10&#39;</span><span class="p">,</span><span class="w"></span>
<span class="w">    </span><span class="nl">success</span><span class="p">:</span><span class="w"> </span><span class="k">function</span><span class="p">(</span><span class="n">response</span><span class="p">)</span><span class="err">{</span><span class="w"></span>
<span class="w">        </span><span class="n">console</span><span class="p">.</span><span class="nf">log</span><span class="p">(</span><span class="n">response</span><span class="p">.</span><span class="k">data</span><span class="p">);</span><span class="w"></span>
<span class="w">    </span><span class="err">}</span><span class="w"></span>
<span class="w">  </span><span class="err">}</span><span class="p">)</span><span class="w"></span>
</code></pre></div>

<h4 id="node-js-example">Node js example</h4>
<div class="codehilite"><pre><span></span><code><span class="nf">var</span><span class="w"> </span><span class="n">request</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">require</span><span class="p">(</span><span class="s1">&#39;request&#39;</span><span class="p">);</span><span class="w"></span>

<span class="nf">var</span><span class="w"> </span><span class="n">headers</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="err">{</span><span class="w"></span>
<span class="w">    </span><span class="s1">&#39;Authorization&#39;</span><span class="err">:</span><span class="w"> </span><span class="s1">&#39;Bearer &lt;AccessToken&gt;&#39;</span><span class="w"></span>
<span class="err">}</span><span class="p">;</span><span class="w"></span>

<span class="nf">var</span><span class="w"> </span><span class="n">options</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="err">{</span><span class="w"></span>
<span class="w">    </span><span class="nl">url</span><span class="p">:</span><span class="w"> </span><span class="s1">&#39;/api/&lt;entityName&gt;?sort=&amp;page[number]=1&amp;page[size]=10&#39;</span><span class="p">,</span><span class="w"></span>
<span class="w">    </span><span class="nl">headers</span><span class="p">:</span><span class="w"> </span><span class="n">headers</span><span class="w"></span>
<span class="err">}</span><span class="p">;</span><span class="w"></span>

<span class="k">function</span><span class="w"> </span><span class="n">callback</span><span class="p">(</span><span class="n">error</span><span class="p">,</span><span class="w"> </span><span class="n">response</span><span class="p">,</span><span class="w"> </span><span class="n">body</span><span class="p">)</span><span class="w"> </span><span class="err">{</span><span class="w"></span>
<span class="w">    </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="err">!</span><span class="n">error</span><span class="w"> </span><span class="o">&amp;&amp;</span><span class="w"> </span><span class="n">response</span><span class="p">.</span><span class="n">statusCode</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="mi">200</span><span class="p">)</span><span class="w"> </span><span class="err">{</span><span class="w"></span>
<span class="w">        </span><span class="n">console</span><span class="p">.</span><span class="nf">log</span><span class="p">(</span><span class="n">body</span><span class="p">);</span><span class="w"></span>
<span class="w">    </span><span class="err">}</span><span class="w"></span>
<span class="err">}</span><span class="w"></span>

<span class="n">request</span><span class="p">(</span><span class="n">options</span><span class="p">,</span><span class="w"> </span><span class="n">callback</span><span class="p">);</span><span class="w"></span>
</code></pre></div>

<h4 id="python-example">Python example</h4>
<div class="codehilite"><pre><span></span><code><span class="kn">import</span> <span class="nn">requests</span>

<span class="n">headers</span> <span class="o">=</span> <span class="p">{</span>
    <span class="s1">&#39;Authorization&#39;</span><span class="p">:</span> <span class="s1">&#39;Bearer &lt;AccessToken&gt;&#39;</span><span class="p">,</span>
<span class="p">}</span>

<span class="n">params</span> <span class="o">=</span> <span class="p">(</span>
    <span class="p">(</span><span class="s1">&#39;sort&#39;</span><span class="p">,</span> <span class="s1">&#39;-created_at&#39;</span><span class="p">),</span>
    <span class="p">(</span><span class="s1">&#39;page[number]&#39;</span><span class="p">,</span> <span class="s1">&#39;1&#39;</span><span class="p">),</span>
    <span class="p">(</span><span class="s1">&#39;page[size]&#39;</span><span class="p">,</span> <span class="s1">&#39;10&#39;</span><span class="p">),</span>
<span class="p">)</span>

<span class="n">response</span> <span class="o">=</span> <span class="n">requests</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;http://localhost:6336/api/laptop&#39;</span><span class="p">,</span> <span class="n">headers</span><span class="o">=</span><span class="n">headers</span><span class="p">,</span> <span class="n">params</span><span class="o">=</span><span class="n">params</span><span class="p">)</span>
</code></pre></div>

<h4 id="php-example">PHP example</h4>
<div class="codehilite"><pre><span></span><code><span class="o">&lt;</span><span class="vm">?</span><span class="n">php</span><span class="w"></span>
<span class="k">include</span><span class="p">(</span><span class="s1">&#39;vendor/rmccue/requests/library/Requests.php&#39;</span><span class="p">);</span><span class="w"></span>
<span class="nl">Requests</span><span class="p">:</span><span class="err">:</span><span class="n">register_autoloader</span><span class="p">();</span><span class="w"></span>
<span class="err">$</span><span class="n">headers</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="k">array</span><span class="p">(</span><span class="w"></span>
<span class="w">    </span><span class="s1">&#39;Authorization&#39;</span><span class="w"> </span><span class="o">=&gt;</span><span class="w"> </span><span class="s1">&#39;Bearer &lt;AccessToken&gt;&#39;</span><span class="w"></span>
<span class="p">);</span><span class="w"></span>
<span class="err">$</span><span class="n">response</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nl">Requests</span><span class="p">:</span><span class="err">:</span><span class="k">get</span><span class="p">(</span><span class="s1">&#39;http://localhost:6336/api/laptop?sort=&amp;page[number]=1&amp;page[size]=10&#39;</span><span class="p">,</span><span class="w"> </span><span class="err">$</span><span class="n">headers</span><span class="p">);</span><span class="w"></span>
</code></pre></div>

<h3 id="filtering">Filtering</h3>
<p>Used to search items in a table that match the filter's conditions. Filters follow the syntax <code>query=[{"column": "&lt;column_name&gt;", "operator": "&lt;compare-operator&gt;", "value":"&lt;value&gt;"}]</code></p>
<table>
<thead>
<tr>
<th>Daptin operator</th>
<th>SQL compare operator</th>
</tr>
</thead>
<tbody>
<tr>
<td>contains</td>
<td>like  '%\<value>'</td>
</tr>
<tr>
<td>not contains</td>
<td>not like  '%\<value>'</td>
</tr>
<tr>
<td>is</td>
<td>=</td>
</tr>
<tr>
<td>is not</td>
<td>!=</td>
</tr>
<tr>
<td>before</td>
<td>&lt;</td>
</tr>
<tr>
<td>less then</td>
<td>&lt;</td>
</tr>
<tr>
<td>after</td>
<td>&gt;</td>
</tr>
<tr>
<td>more then</td>
<td>&gt;</td>
</tr>
<tr>
<td>any of</td>
<td>in</td>
</tr>
<tr>
<td>none of</td>
<td>not in</td>
</tr>
<tr>
<td>is empty</td>
<td>is null</td>
</tr>
<tr>
<td>is not empty</td>
<td>is not null</td>
</tr>
</tbody>
</table>
<h4 id="example">Example</h4>
<div class="codehilite"><pre><span></span><code>curl &#39;/api/world?query=[{&quot;column&quot;: &quot;is_hidden&quot;, &quot;operator&quot;: &quot;any of&quot;, &quot;value&quot;:&quot;1,0&quot;}] \
  -H &#39;Authorization: Bearer &lt;AccessToken&gt;&#39;
</code></pre></div>

<h2 id="create">Create</h2>
<div class="admonition example">
<p class="admonition-title">Curl Example</p>
<div class="highlight"><pre><span></span><code>curl &#39;/api/&lt;EntityName&gt;&#39;
    -H &#39;Authorization: Bearer &lt;Token&gt;&#39;
    --data-binary &#39;{
                &quot;data&quot;: {
                    &quot;type&quot;: &quot;&lt;EntityName&gt;&quot;,
                    &quot;attributes&quot;: {
                        &quot;name&quot;: &quot;name&quot;
                    }
                }
           }&#39;
</code></pre></div>
</div>
<div class="admonition example">
<p class="admonition-title">Nodejs example</p>
<div class="highlight"><pre><span></span><code>var request = require(&#39;request&#39;);

var headers = {
    &#39;Authorization&#39;: &#39;Bearer &lt;Token&gt;&#39;,
};

var dataString = &#39;{
                    &quot;data&quot;: {
                        &quot;type&quot;: &quot;&lt;EntityName&gt;&quot;,
                        &quot;attributes&quot;: {
                            &quot;name&quot;: &quot;name&quot;
                        }
                    }
                  }&#39;;

var options = {
    url: &#39;/api/&lt;EntityName&gt;&#39;,
    method: &#39;POST&#39;,
    headers: headers,
    body: dataString
};

function callback(error, response, body) {
    if (!error &amp;&amp; response.statusCode == 200) {
        console.log(body);
    }
}

request(options, callback);
</code></pre></div>
</div>
<div class="admonition example">
<p class="admonition-title">Python example</p>
<div class="highlight"><pre><span></span><code><span class="kn">import</span> <span class="nn">requests</span>

<span class="n">headers</span> <span class="o">=</span> <span class="p">{</span>
    <span class="s1">&#39;Authorization&#39;</span><span class="p">:</span> <span class="s1">&#39;Bearer &lt;Token&gt;&#39;</span><span class="p">,</span>
<span class="p">}</span>

<span class="n">data</span> <span class="o">=</span> <span class="s1">&#39;{</span>
            <span class="s2">&quot;data&quot;</span><span class="p">:</span> <span class="p">{</span>
                <span class="s2">&quot;type&quot;</span><span class="p">:</span> <span class="s2">&quot;&lt;EntityName&gt;&quot;</span><span class="p">,</span>
                <span class="s2">&quot;attributes&quot;</span><span class="p">:</span> <span class="p">{</span>
                    <span class="s2">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;name&quot;</span>
                <span class="p">}</span>
            <span class="p">}</span>
        <span class="p">}</span><span class="s1">&#39;</span>

<span class="n">response</span> <span class="o">=</span> <span class="n">requests</span><span class="o">.</span><span class="n">post</span><span class="p">(</span><span class="s1">&#39;/api/&lt;EntityName&gt;&#39;</span><span class="p">,</span> <span class="n">headers</span><span class="o">=</span><span class="n">headers</span><span class="p">,</span> <span class="n">data</span><span class="o">=</span><span class="n">data</span><span class="p">)</span>
</code></pre></div>
</div>
<div class="admonition example">
<p class="admonition-title">PHP Example</p>
<div class="highlight"><pre><span></span><code><span class="cp">&lt;?php</span>
<span class="k">include</span><span class="p">(</span><span class="s1">&#39;vendor/rmccue/requests/library/Requests.php&#39;</span><span class="p">);</span>
<span class="nx">Requests</span><span class="o">::</span><span class="na">register_autoloader</span><span class="p">();</span>
<span class="nv">$headers</span> <span class="o">=</span> <span class="k">array</span><span class="p">(</span>
    <span class="s1">&#39;Authorization&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;Bearer &lt;Token&gt;&#39;</span><span class="p">,</span>
<span class="p">);</span>
<span class="nv">$data</span> <span class="o">=</span> <span class="s1">&#39;{</span>
<span class="s1">            &quot;data&quot;: {</span>
<span class="s1">                &quot;type&quot;: &quot;&lt;EntityName&gt;&quot;,</span>
<span class="s1">                &quot;attributes&quot;: {</span>
<span class="s1">                    &quot;name&quot;: &quot;name&quot;</span>
<span class="s1">                }</span>
<span class="s1">            }</span>
<span class="s1">         }&#39;</span><span class="p">;</span>
<span class="nv">$response</span> <span class="o">=</span> <span class="nx">Requests</span><span class="o">::</span><span class="na">post</span><span class="p">(</span><span class="s1">&#39;/api/&lt;EntityName&gt;&#39;</span><span class="p">,</span> <span class="nv">$headers</span><span class="p">,</span> <span class="nv">$data</span><span class="p">);</span>
</code></pre></div>
</div>
<h2 id="update">Update</h2>
<div class="admonition example">
<p class="admonition-title">Curl example</p>
<div class="highlight"><pre><span></span><code>curl &#39;/api/&lt;EntityName&gt;/&lt;ReferenceId&gt;&#39; \
-X PATCH \
-H &#39;Authorization: Bearer &lt;Token&gt;&#39; \
--data-binary &#39;{
                &quot;data&quot;: {
                    &quot;type&quot;: &quot;&lt;EntityName&gt;&quot;,
                    &quot;attributes&quot;: {
                        &quot;confirmed&quot;: false,
                        &quot;email&quot;: &quot;update@gmail.com&quot;,
                        &quot;name&quot;: &quot;new name&quot;,
                        &quot;password&quot;: &quot;&quot;
                    },
                    &quot;id&quot;: &quot;&lt;ReferenceId&gt;&quot;
                }
              }&#39;
</code></pre></div>
</div>
<div class="admonition example">
<p class="admonition-title">Nodejs example</p>
<div class="highlight"><pre><span></span><code>var request = require(&#39;request&#39;);

var headers = {
    &#39;Authorization&#39;: &#39;Bearer &lt;Token&gt;&#39;
};

var dataString = &#39;{
                  &quot;data&quot;: {
                      &quot;type&quot;: &quot;&lt;EntityName&gt;&quot;,
                      &quot;attributes&quot;: {
                          &quot;confirmed&quot;: false,
                          &quot;email&quot;: &quot;update@gmail.com&quot;,
                          &quot;name&quot;: &quot;new name&quot;,
                          &quot;password&quot;: &quot;&quot;,
                          &quot;permission&quot;: 127127127,
                      },
                      &quot;relationships&quot;: {
                          &quot;relation_name&quot;: [ ... ]
                      },
                      &quot;id&quot;: &quot;&lt;ReferenceId&gt;&quot;
                  }
                }&#39;;

var options = {
    url: &#39;/api/&lt;EntityName&gt;/&lt;ReferenceId&gt;&#39;,
    method: &#39;PATCH&#39;,
    headers: headers,
    body: dataString
};

function callback(error, response, body) {
    if (!error &amp;&amp; response.statusCode == 200) {
        console.log(body);
    }
}


request(options, callback);
</code></pre></div>
</div>
<div class="admonition example">
<p class="admonition-title">Python example</p>
<div class="highlight"><pre><span></span><code><span class="kn">import</span> <span class="nn">requests</span>

<span class="n">headers</span> <span class="o">=</span> <span class="p">{</span>
    <span class="s1">&#39;Authorization&#39;</span><span class="p">:</span> <span class="s1">&#39;Bearer &lt;Token&gt;&#39;</span><span class="p">,</span>
<span class="p">}</span>

<span class="n">data</span> <span class="o">=</span> <span class="s1">&#39;{</span>
          <span class="s2">&quot;data&quot;</span><span class="p">:</span> <span class="p">{</span>
              <span class="s2">&quot;type&quot;</span><span class="p">:</span> <span class="s2">&quot;&lt;EntityName&gt;&quot;</span><span class="p">,</span>
              <span class="s2">&quot;attributes&quot;</span><span class="p">:</span> <span class="p">{</span>
                  <span class="s2">&quot;confirmed&quot;</span><span class="p">:</span> <span class="n">false</span><span class="p">,</span>
                  <span class="s2">&quot;email&quot;</span><span class="p">:</span> <span class="s2">&quot;update@gmail.com&quot;</span><span class="p">,</span>
                  <span class="s2">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;new name&quot;</span><span class="p">,</span>
                  <span class="s2">&quot;password&quot;</span><span class="p">:</span> <span class="s2">&quot;&quot;</span><span class="p">,</span>
                  <span class="s2">&quot;permission&quot;</span><span class="p">:</span> <span class="mi">127127127</span><span class="p">,</span>
              <span class="p">},</span>
              <span class="s2">&quot;relationships&quot;</span><span class="p">:</span> <span class="p">{</span>
                  <span class="s2">&quot;relation_name&quot;</span><span class="p">:</span> <span class="p">[</span> <span class="o">...</span> <span class="p">]</span>
              <span class="p">},</span>
              <span class="s2">&quot;id&quot;</span><span class="p">:</span> <span class="s2">&quot;&lt;ReferenceId&gt;&quot;</span>
          <span class="p">}</span>
        <span class="p">}</span><span class="s1">&#39;</span>

<span class="n">response</span> <span class="o">=</span> <span class="n">requests</span><span class="o">.</span><span class="n">patch</span><span class="p">(</span><span class="s1">&#39;/api/&lt;EntityName&gt;/&lt;ReferenceId&gt;&#39;</span><span class="p">,</span> <span class="n">headers</span><span class="o">=</span><span class="n">headers</span><span class="p">,</span> <span class="n">data</span><span class="o">=</span><span class="n">data</span><span class="p">)</span>
</code></pre></div>
</div>
<div class="admonition example">
<p class="admonition-title">PHP example</p>
<div class="highlight"><pre><span></span><code><span class="cp">&lt;?php</span>
<span class="k">include</span><span class="p">(</span><span class="s1">&#39;vendor/rmccue/requests/library/Requests.php&#39;</span><span class="p">);</span>
<span class="nx">Requests</span><span class="o">::</span><span class="na">register_autoloader</span><span class="p">();</span>
<span class="nv">$headers</span> <span class="o">=</span> <span class="k">array</span><span class="p">(</span>
    <span class="s1">&#39;Authorization&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;Bearer &lt;Token&gt;&#39;</span>
<span class="p">);</span>
<span class="nv">$data</span> <span class="o">=</span> <span class="s1">&#39;{</span>
<span class="s1">           &quot;data&quot;: {</span>
<span class="s1">               &quot;type&quot;: &quot;&lt;EntityName&gt;&quot;,</span>
<span class="s1">               &quot;attributes&quot;: {</span>
<span class="s1">                   &quot;confirmed&quot;: false,</span>
<span class="s1">                   &quot;email&quot;: &quot;update@gmail.com&quot;,</span>
<span class="s1">                   &quot;name&quot;: &quot;new name&quot;,</span>
<span class="s1">                   &quot;password&quot;: &quot;&quot;,</span>
<span class="s1">                   &quot;permission&quot;: 127127127,</span>
<span class="s1">               },</span>
<span class="s1">               &quot;relationships&quot;: {</span>
<span class="s1">                   &quot;relation_name&quot;: [ ... ]</span>
<span class="s1">               },</span>
<span class="s1">               &quot;id&quot;: &quot;&lt;ReferenceId&gt;&quot;</span>
<span class="s1">           }</span>
<span class="s1">         }&#39;</span><span class="p">;</span>
<span class="nv">$response</span> <span class="o">=</span> <span class="nx">Requests</span><span class="o">::</span><span class="na">patch</span><span class="p">(</span><span class="s1">&#39;/api/&lt;EntityName&gt;/&lt;ReferenceId&gt;&#39;</span><span class="p">,</span> <span class="nv">$headers</span><span class="p">,</span> <span class="nv">$data</span><span class="p">);</span>
</code></pre></div>
</div>
<h2 id="delete">Delete</h2>
<p>Delete a row from a table</p>
<div class="admonition example">
<p class="admonition-title">Curl example</p>
<div class="highlight"><pre><span></span><code>curl <span class="s1">&#39;/api/user_account/a5b9add2-ea56-4717-a785-7dee71a2ae46&#39;</span> -X DELETE  -H <span class="s1">&#39;Authorization: Bearer &lt;Token&gt;&#39;</span>
</code></pre></div>
</div>
<div class="admonition example">
<p class="admonition-title">Nodejs example</p>
<div class="highlight"><pre><span></span><code>var request = require(&#39;request&#39;);

var headers = {
    &#39;Authorization&#39;: &#39;Bearer &lt;Token&gt;&#39;
};

var options = {
    url: &#39;/api/user_account/a5b9add2-ea56-4717-a785-7dee71a2ae46&#39;,
    method: &#39;DELETE&#39;,
    headers: headers
};

function callback(error, response, body) {
    if (!error &amp;&amp; response.statusCode == 200) {
        console.log(body);
    }
}

request(options, callback);
</code></pre></div>
</div>
<div class="admonition example">
<p class="admonition-title">Python example</p>
<div class="highlight"><pre><span></span><code><span class="kn">import</span> <span class="nn">requests</span>

<span class="n">headers</span> <span class="o">=</span> <span class="p">{</span>
    <span class="s1">&#39;Authorization&#39;</span><span class="p">:</span> <span class="s1">&#39;Bearer &lt;Token&gt;&#39;</span><span class="p">,</span>
<span class="p">}</span>

<span class="n">response</span> <span class="o">=</span> <span class="n">requests</span><span class="o">.</span><span class="n">delete</span><span class="p">(</span><span class="s1">&#39;/api/user_account/a5b9add2-ea56-4717-a785-7dee71a2ae46&#39;</span><span class="p">,</span> <span class="n">headers</span><span class="o">=</span><span class="n">headers</span><span class="p">)</span>
</code></pre></div>
</div>
<div class="admonition example">
<p class="admonition-title">PHP example</p>
<div class="highlight"><pre><span></span><code><span class="cp">&lt;?php</span>
<span class="k">include</span><span class="p">(</span><span class="s1">&#39;vendor/rmccue/requests/library/Requests.php&#39;</span><span class="p">);</span>
<span class="nx">Requests</span><span class="o">::</span><span class="na">register_autoloader</span><span class="p">();</span>
<span class="nv">$headers</span> <span class="o">=</span> <span class="k">array</span><span class="p">(</span>
    <span class="s1">&#39;Authorization&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;Bearer &lt;Token&gt;&#39;</span>
<span class="p">);</span>
<span class="nv">$response</span> <span class="o">=</span> <span class="nx">Requests</span><span class="o">::</span><span class="na">delete</span><span class="p">(</span><span class="s1">&#39;/api/user_account/a5b9add2-ea56-4717-a785-7dee71a2ae46&#39;</span><span class="p">,</span> <span class="nv">$headers</span><span class="p">);</span>
</code></pre></div>
</div>
<h2 id="execute">Execute</h2>
<p>Execute an action on an entity type or instance</p>
<div class="admonition example">
<p class="admonition-title">Curl example</p>
<div class="highlight"><pre><span></span><code>curl &#39;/action/&lt;EntityName&gt;/&lt;ActionName&gt;&#39;  -H &#39;Authorization: Bearer &lt;Token&gt;&#39;  --data-binary &#39;{&quot;attributes&quot;:{}}&#39;
</code></pre></div>
</div>
<div class="admonition example">
<p class="admonition-title">PHP Example</p>
<div class="highlight"><pre><span></span><code><span class="cp">&lt;?php</span>
<span class="k">include</span><span class="p">(</span><span class="s1">&#39;vendor/rmccue/requests/library/Requests.php&#39;</span><span class="p">);</span>
<span class="nx">Requests</span><span class="o">::</span><span class="na">register_autoloader</span><span class="p">();</span>
<span class="nv">$headers</span> <span class="o">=</span> <span class="k">array</span><span class="p">(</span>
    <span class="s1">&#39;Authorization&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;Bearer &lt;Token&gt;&#39;</span>
<span class="p">);</span>
<span class="nv">$data</span> <span class="o">=</span> <span class="s1">&#39;{&quot;attributes&quot;:{}}&#39;</span><span class="p">;</span>
<span class="nv">$response</span> <span class="o">=</span> <span class="nx">Requests</span><span class="o">::</span><span class="na">post</span><span class="p">(</span><span class="s1">&#39;/action/&lt;EntityName&gt;/&lt;ActionName&gt;&#39;</span><span class="p">,</span> <span class="nv">$headers</span><span class="p">,</span> <span class="nv">$data</span><span class="p">);</span>
</code></pre></div>
</div>
<div class="admonition example">
<p class="admonition-title">Nodejs example</p>
<div class="highlight"><pre><span></span><code>var request = require(&#39;request&#39;);

var headers = {
    &#39;Authorization&#39;: &#39;Bearer &lt;Token&gt;&#39;
};

var dataString = &#39;{&quot;attributes&quot;:{}}&#39;;

var options = {
    url: &#39;/action/&lt;EntityName&gt;/&lt;ActionName&gt;&#39;,
    method: &#39;POST&#39;,
    headers: headers,
    body: dataString
};

function callback(error, response, body) {
    if (!error &amp;&amp; response.statusCode == 200) {
        console.log(body);
    }
}

request(options, callback);
</code></pre></div>
</div>
<div class="admonition example">
<p class="admonition-title">Python example</p>
<div class="highlight"><pre><span></span><code><span class="kn">import</span> <span class="nn">requests</span>

<span class="n">headers</span> <span class="o">=</span> <span class="p">{</span>
    <span class="s1">&#39;Authorization&#39;</span><span class="p">:</span> <span class="s1">&#39;Bearer &lt;Token&gt;&#39;</span><span class="p">,</span>
<span class="p">}</span>

<span class="n">data</span> <span class="o">=</span> <span class="s1">&#39;{&quot;attributes&quot;:</span><span class="si">{}</span><span class="s1">}&#39;</span>

<span class="n">response</span> <span class="o">=</span> <span class="n">requests</span><span class="o">.</span><span class="n">post</span><span class="p">(</span><span class="s1">&#39;/action/&lt;EntityName&gt;/&lt;ActionName&gt;&#39;</span><span class="p">,</span> <span class="n">headers</span><span class="o">=</span><span class="n">headers</span><span class="p">,</span> <span class="n">data</span><span class="o">=</span><span class="n">data</span><span class="p">)</span>
</code></pre></div>
</div>
<h2 id="relations">Relations</h2>
<div class="admonition example">
<p class="admonition-title">curl example</p>
<div class="highlight"><pre><span></span><code>curl <span class="s1">&#39;/api/&lt;EntityName&gt;/&lt;ReferenceId&gt;/&lt;RelationName&gt;?sort=&amp;page[number]=1&amp;page[size]=10&#39;</span>  -H <span class="s1">&#39;Authorization: Bearer &lt;Token&gt;&#39;</span>
</code></pre></div>
</div>
<div class="admonition example">
<p class="admonition-title">php example</p>
<div class="highlight"><pre><span></span><code><span class="cp">&lt;?php</span>
<span class="k">include</span><span class="p">(</span><span class="s1">&#39;vendor/rmccue/requests/library/Requests.php&#39;</span><span class="p">);</span>
<span class="nx">Requests</span><span class="o">::</span><span class="na">register_autoloader</span><span class="p">();</span>
<span class="nv">$headers</span> <span class="o">=</span> <span class="k">array</span><span class="p">(</span>
    <span class="s1">&#39;Authorization&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;Bearer &lt;Token&gt;&#39;</span>
<span class="p">);</span>
</code></pre></div>
</div>
<div class="admonition example">
<p class="admonition-title">python example</p>
<div class="highlight"><pre><span></span><code><span class="kn">import</span> <span class="nn">requests</span>

<span class="n">headers</span> <span class="o">=</span> <span class="p">{</span>
    <span class="s1">&#39;Authorization&#39;</span><span class="p">:</span> <span class="s1">&#39;Bearer &lt;Token&gt;&#39;</span><span class="p">,</span>
<span class="p">}</span>

<span class="n">params</span> <span class="o">=</span> <span class="p">(</span>
    <span class="p">(</span><span class="s1">&#39;sort&#39;</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">),</span>
    <span class="p">(</span><span class="s1">&#39;page/[number/]&#39;</span><span class="p">,</span> <span class="s1">&#39;1&#39;</span><span class="p">),</span>
    <span class="p">(</span><span class="s1">&#39;page/[size/]&#39;</span><span class="p">,</span> <span class="s1">&#39;10&#39;</span><span class="p">),</span>
<span class="p">)</span>

<span class="n">response</span> <span class="o">=</span> <span class="n">requests</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;http://localhost:6336/api/user_account/696c98d3-3b8b-41da-a510-08e6948cf661/marketplace_id&#39;</span><span class="p">,</span> <span class="n">headers</span><span class="o">=</span><span class="n">headers</span><span class="p">,</span> <span class="n">params</span><span class="o">=</span><span class="n">params</span><span class="p">)</span>

<span class="c1">#NB. Original query string below. It seems impossible to parse and</span>
<span class="c1">#reproduce query strings 100% accurately so the one below is given</span>
<span class="c1">#in case the reproduced version is not &quot;correct&quot;.</span>
<span class="c1"># response = requests.get(&#39;http://localhost:6336/api/user_account/696c98d3-3b8b-41da-a510-08e6948cf661/marketplace_id?sort=&amp;page\[number\]=1&amp;page\[size\]=10&#39;, headers=headers)</span>
</code></pre></div>
</div>
<div class="admonition example">
<p class="admonition-title">nodejs example</p>
<div class="highlight"><pre><span></span><code>var request = require(&#39;request&#39;);

var headers = {
    &#39;Authorization&#39;: &#39;Bearer &lt;Token&gt;&#39;
};

var options = {
    url: &#39;/api/&lt;EntityName&gt;/&lt;ReferenceId&gt;/&lt;RelationName&gt;?sort=&amp;page[number]=1&amp;page[size]=10&#39;,
    headers: headers
};

function callback(error, response, body) {
    if (!error &amp;&amp; response.statusCode == 200) {
        console.log(body);
    }
}

request(options, callback);
</code></pre></div>
</div>
<div class="admonition example">
<p class="admonition-title">python example</p>
<div class="highlight"><pre><span></span><code><span class="kn">import</span> <span class="nn">requests</span>

<span class="n">headers</span> <span class="o">=</span> <span class="p">{</span>
    <span class="s1">&#39;Authorization&#39;</span><span class="p">:</span> <span class="s1">&#39;Bearer &lt;Token&gt;&#39;</span><span class="p">,</span>
<span class="p">}</span>

<span class="n">params</span> <span class="o">=</span> <span class="p">(</span>
    <span class="p">(</span><span class="s1">&#39;sort&#39;</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">),</span>
    <span class="p">(</span><span class="s1">&#39;page[number]&#39;</span><span class="p">,</span> <span class="s1">&#39;1&#39;</span><span class="p">),</span>
    <span class="p">(</span><span class="s1">&#39;page[size]&#39;</span><span class="p">,</span> <span class="s1">&#39;10&#39;</span><span class="p">),</span>
<span class="p">)</span>

<span class="n">response</span> <span class="o">=</span> <span class="n">requests</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;/api/&lt;EntityName&gt;/&lt;ReferenceId&gt;/&lt;RelationName&gt;&#39;</span><span class="p">,</span> <span class="n">headers</span><span class="o">=</span><span class="n">headers</span><span class="p">,</span> <span class="n">params</span><span class="o">=</span><span class="n">params</span><span class="p">)</span>
</code></pre></div>
</div>
<h2 id="api-overview">API Overview</h2>
<h3 id="crud-api">CRUD API</h3>
<p>Read/Create/Update/Delete</p>
<table>
<thead>
<tr>
<th>GET</th>
<th>/api/{entityName}</th>
<th>Query Params</th>
<th>Request Body</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>GET</td>
<td>/api/{entityName}</td>
<td>page[size]= page[number] query filter</td>
<td></td>
<td><a href="#read">Detailed documentation</a></td>
</tr>
<tr>
<td>POST</td>
<td>/api/{entityName}</td>
<td></td>
<td></td>
<td>Find all rows, paginated with query and filters <a href="#create">Example</a></td>
</tr>
<tr>
<td>PATCH</td>
<td>/api/{entityName}/{id}</td>
<td></td>
<td>{"attributes": { ...{fields} } "type": "{entityType} }</td>
<td>Update row by reference id <a href="#update">Example</a></td>
</tr>
<tr>
<td>PUT</td>
<td>/api/{entityName}/{id}</td>
<td></td>
<td>{"attributes": { } "type": "{entityType} }</td>
<td>Update row by reference id  <a href="#update">Example</a></td>
</tr>
<tr>
<td>DELETE</td>
<td>/api/{entityName}/{id}</td>
<td></td>
<td></td>
<td>Delete a row  <a href="#delete">Example</a></td>
</tr>
</tbody>
</table>
<h3 id="action-api">Action API</h3>
<table>
<thead>
<tr>
<th>GET</th>
<th>/action/{entityName}/{actionName}</th>
<th>Query Params</th>
<th>Request Body</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>POST</td>
<td>/api/{entityName}/</td>
<td>action parameters</td>
<td>Action Parameters</td>
<td>Execute action</td>
</tr>
</tbody>
</table>
<h3 id="relation-apis">Relation APIs</h3>
<table>
<thead>
<tr>
<th>Method</th>
<th>Path</th>
<th>Query params</th>
<th>Request body</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>GET</td>
<td>/api/{entityName}/{id}/{relationName}</td>
<td>page[size]= page[number] query filter</td>
<td></td>
<td>Find all related rows by relation name, eg, "posts" of a user</td>
</tr>
<tr>
<td>DELETE</td>
<td>/api/{entityName}/{id}/{relationName}</td>
<td></td>
<td>{"id": , "type":  }</td>
<td>Delete a related row, eg: delete post of a user. this only removes a relation and not the actual row.</td>
</tr>
<tr>
<td>GET</td>
<td>/action/{entityName}/{actionName}</td>
<td>Parameters for action</td>
<td></td>
<td>Invoke an action on an entity</td>
</tr>
<tr>
<td>POST</td>
<td>/action/{entityName}/{actionName}</td>
<td></td>
<td>{ "attribute": { Parameters for action }, "id": "&lt; object id &gt;" type: "&lt; entity type &gt;" }</td>
<td>Invoke an action on an entity</td>
</tr>
</tbody>
</table>
<h3 id="aggregate-api">Aggregate API</h3>
<table>
<thead>
<tr>
<th>Method</th>
<th>Path</th>
<th>Query params</th>
<th>Request body</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>GET</td>
<td>/stats/{typeName}</td>
<td>group/filter/join/column/timestamp/timefrom/timeto/order</td>
<td></td>
<td>Run aggregate function over entity table</td>
</tr>
</tbody>
</table>
<h3 id="state-machine-apis">State machine APIs</h3>
<p>Enabled for the entities for which you have enabled state machines</p>
<table>
<thead>
<tr>
<th>Method</th>
<th>Path</th>
<th>Query params</th>
<th>Request body</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>POST</td>
<td>/track/start/{stateMachineId}</td>
<td></td>
<td>{ "id": " &lt; reference id &gt;", type: " &lt; entity type &gt; " }</td>
<td>Start tracking according to the state machine for an object</td>
</tr>
<tr>
<td>POST</td>
<td>/track/event/{typename}/{objectStateId}/{eventName}</td>
<td></td>
<td></td>
<td>Invoke an event on a particular track of the state machine for a object</td>
</tr>
</tbody>
</table>
<h3 id="websocket-api-wip">Websocket API (wip)</h3>
<p>Listed to incoming updates to data over websocket live</p>
<table>
<thead>
<tr>
<th>Method</th>
<th>Path</th>
<th>Query params</th>
<th>Request body</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>GET</td>
<td>/live</td>
<td></td>
<td></td>
<td>Initiate a web socket connection</td>
</tr>
</tbody>
</table>
<h3 id="metadata-api">Metadata API</h3>
<p>Meatadata APIs expose information about the daptin server itself</p>
<table>
<thead>
<tr>
<th>Method</th>
<th>Path</th>
<th>Query params</th>
<th>Request body</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>GET</td>
<td>/apispec.raml</td>
<td></td>
<td></td>
<td>RAML Spec for all API's  exposed by the current instance</td>
</tr>
<tr>
<td>GET</td>
<td>/ping</td>
<td></td>
<td></td>
<td>Replies with PONG, Endpoint for liveness probe</td>
</tr>
<tr>
<td>GET</td>
<td>/statistics</td>
<td></td>
<td></td>
<td>Replies with PONG, Endpoint for healht check probe</td>
</tr>
</tbody>
</table>

              
            </article>
          </div>
        </div>
        
      </main>
      
        <footer class="md-footer">
  
    <nav class="md-footer__inner md-grid" aria-label="Footer">
      
        
        <a href="./" class="md-footer__link md-footer__link--prev" aria-label="Previous: State machine API" rel="prev">
          <div class="md-footer__button md-icon">
            <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>
          </div>
          <div class="md-footer__title">
            <div class="md-ellipsis">
              <span class="md-footer__direction">
                Previous
              </span>
              State machine API
            </div>
          </div>
        </a>
      
      
        
        <a href="../../actions/actions/" class="md-footer__link md-footer__link--next" aria-label="Next: What are actions" rel="next">
          <div class="md-footer__title">
            <div class="md-ellipsis">
              <span class="md-footer__direction">
                Next
              </span>
              What are actions
            </div>
          </div>
          <div class="md-footer__button md-icon">
            <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 11v2h12l-5.5 5.5 1.42 1.42L19.84 12l-7.92-7.92L10.5 5.5 16 11H4z"/></svg>
          </div>
        </a>
      
    </nav>
  
  <div class="md-footer-meta md-typeset">
    <div class="md-footer-meta__inner md-grid">
      <div class="md-copyright">
  
  
    Made with
    <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
      Material for MkDocs
    </a>
  
</div>
      
    </div>
  </div>
</footer>
      
    </div>
    <div class="md-dialog" data-md-component="dialog">
      <div class="md-dialog__inner md-typeset"></div>
    </div>
    <script id="__config" type="application/json">{"base": "../..", "features": [], "translations": {"clipboard.copy": "Copy to clipboard", "clipboard.copied": "Copied to clipboard", "search.config.lang": "en", "search.config.pipeline": "trimmer, stopWordFilter", "search.config.separator": "[\\s\\-]+", "search.placeholder": "Search", "search.result.placeholder": "Type to start searching", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.term.missing": "Missing", "select.version.title": "Select version"}, "search": "../../assets/javascripts/workers/search.bd0b6b67.min.js"}</script>
    
    
      <script src="../../assets/javascripts/bundle.5413a266.min.js"></script>
      
    
  </body>
</html>